package xyz.liuyuhe.StudySpring.ch7.objenesis;

import org.springframework.objenesis.Objenesis;
import org.springframework.objenesis.ObjenesisStd;
import org.springframework.objenesis.instantiator.ObjectInstantiator;

public class ObjenesisTest {
    public static void main(String[] args) {
        Objenesis objenesis = new ObjenesisStd();
        ObjectInstantiator<User> thingyInstantiator 
            = objenesis.getInstantiatorOf(User.class);
        User user = thingyInstantiator.newInstance();
        user.setId("1");
        user.setName("liuyh");
        
        System.out.println(user);
    }
}
